package com.tzy.common.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.boot.jackson.JsonComponent;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 用户评价表
 * </p>
 * @author 谭同学
 * @since 2022-03-02
 */
@Data
public class Evaluation implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Dishes dishes;
    @TableField(exist = false)
    private User user;
    @TableField(exist = false)
    private Shop shop;
    /**
     * 一对多映射
     */
    @TableField(exist = false)
    private List<Evaluation> evaluationList;
    /**
     * 评价编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户编号
     */
    private Integer userId;

    /**
     * 菜品编号
     */
    private Integer dishesId;
    /**
     * 店铺编号
     */
    private Integer shopId;

    /**
     * 评价描述;评价内容
     */
    private String evaluationDescribe;
    /**
     * 评价的视频或图片网址
     */
    private String videoOrImageUrlOfTheReview;
    /**
     * 评价分数 (没有评价则默认五星好评)
     */
    private Integer evaluationScore;
    /**
     * 被浏览次数
     */
    private Integer viewed;
    /**
     * 订单送达花费时间
     */
    private Integer deliveryTime;

    /**
     * 评价日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime evaluationDate;
    /**
     * 评价状态
     */
    private Integer evaluationStatus;
}
